<?php

#--------------------------------------------------
# ALL INCLUDES + STANDARD-VALUES
#--------------------------------------------------
include_once ("include/config.inc");
include_once ("include/template.inc");
include_once ("include/class.db.php5");
include_once ("include/class.tools.php5");
$svo = new db("svoptik");
$tools = new tool();

include_once ("include/global_fix_extern.inc");

#--------------------------------------------------
# CREATE TEMPLATE
#--------------------------------------------------
$t = new Template("templates", "keep");
$t->set_file(array (
	"page" => "svoptik.tpl",
	"ticker" => "ticker.tpl",
	"navi" => "navi.tpl",
	"time" => "t_time.tpl"
));
#--------------------------------------------------

$t->set_var(array (
	"FORWARD" => ""
));
#--------------------------------------------------
# CREATE NAVIGATION RIGHT
#--------------------------------------------------
$links = "";
$url[0] = array (
	"URL" => "where_to_find.php5",
	"URL-TEXT" => "Stadtplan"
);
for ($i = 0; $i < count($url); $i++) {
	$links .= "
	        <tr height=\"15\">
				<td valign=\"top\"><img src=\"standard/spacer.gif\" width=\"20\" height=\"15\" border=\"0\" alt=\"\"></td>
				<td valign=\"top\"><a href=\"" . $url[$i]['URL'] . "\" class=\"sitenav\">" . $url[$i]['URL-TEXT'] . "</a></td>
				<td valign=\"top\"><img src=\"standard/spacer.gif\" width=\"20\" height=\"15\" border=\"0\" alt=\"\"></td>
			</tr>
	       ";
}
$t->set_var(array (
	"LINKS" => $links,
	"BANNER" => $banner
));
$right_nav = $t->parse("", "navi", true);
#--------------------------------------------------

#--------------------------------------------------
# CREATE TICKER
#--------------------------------------------------
$ticker = "";

$sql = $svo->doSQL("select * from " . $table['Berichte'] . " WHERE cat='TICKER' order by date desc limit 1;");

while ($tupel = $svo->getRecordset($sql)) {
	$t->set_var(array (
		"TICKER" => substr($tools->html_replace($tupel['text']
	), 0, 250)));
	$ticker .= $t->parse("", "ticker", true);

}
#--------------------------------------------------

#--------------------------------------------------
# CREATE CONTENT "ANSPRECHPARTNER"
#--------------------------------------------------
$content = $t->parse("", "time", true);
#--------------------------------------------------

#--------------------------------------------------
# PARSE & OUTPUT
#--------------------------------------------------
$t->set_var(array (
	"sitenav" => "INFOS -> TRAININGSZEITEN",
	"ticker" => $ticker,
	"content" => $content . "<br>",
	"navi" => $right_nav,
	"SYNCHRONIZE" => " "
));

$t->parse("ALL", "page", true);
$t->p("ALL");
?>
